package tournoi.utils;

import java.util.Properties;

import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;

import tournoi.stateless.TournoiFacade;

//import org.jbo

public class Main {
	public static void main(String[] args) {
		Properties jndiProps = new Properties();
		// jndiProps.put(Context.URL_PKG_PREFIXES,
		// "org.jboss.ejb.client.naming");
		jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,
				"org.jboss.naming.remote.client.InitialContextFactory");
		jndiProps.put(Context.PROVIDER_URL, "remote://localhost:4447");
		// username
		jndiProps.put(Context.SECURITY_AUTHENTICATION, "master22");
		// password
		jndiProps.put(Context.SECURITY_CREDENTIALS, "miage2");
		// create a context passing these properties

		// jndiProps.put("jboss.naming.client.ejb.context", true);
		try {
			Context ctx = new InitialContext(jndiProps);
			TournoiFacade tf = (TournoiFacade) ctx
					.lookup("TournoiFacade/remote");
			// System.out.println(bk.getAllArticles());
		} catch (NamingException ne) {
			ne.printStackTrace();
		}

	}
}